/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package parse;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.util.Scanner;
import java.util.Stack;

/**
 *
 * @author dlao
 */
public class Parse {

    private Node root;

    private static class Node {

        Node left;
        Node right;
        int data;

        Node(int newData) {
            left = null;
            right = null;
            data = newData;
        }
    }

    public Parse() {
        root = null;
    }

    public void insert(int data) { //Method to call recurison insert();
        root = insert(root, data);
    }

    public Node insert(Node node, int data) { //Binary tree insert

        if (node == null) {
            node = new Node(data); //set node value = data
        } else {
            if (data <= node.data) {
                node.left = insert(node.left, data);
            } else {
                node.right = insert(node.right, data);
            }
        }

        return node;
    }

    public boolean lookup(int data) {
        return (lookup(root, data));
    }
//
//    /** 
//    Recursive lookup  -- given a node, recur 
//    down searching for the given data. 
//     */

    private boolean lookup(Node node, int data) {
        if (node == null) {
            System.out.println("false");
            return (false);
        }

        if (data == node.data) {
            //  System.out.println("true " + node.data);
            return (true);
        } else if (data < node.data) {
            // System.out.println("data < node.data: " + node.data);
            return (lookup(node.left, data));
        } else {
            System.out.println("data > node.data: " + node.data);

            return (lookup(node.right, data));
        }
    }

    public void toStackAndPostfix(String str2) {
        String[] str = str2.split("\\s+");
        String str3 = "";
        int y = 0;
        for (int x = 0; x < str.length; x++) {
            str3 = str3 + str[x];
        }
        Stack sk = new Stack();
        String postfix = "";

        for (int x = 0; x < str3.length(); x++) {

       

        }
        System.out.println(postfix);
//        if(!sk.isEmpty()){
//            for(int x = 0 ; x<sk.capacity();x++){
//                postfix = postfix + sk.pop();
//            }
//        }

//  
    }

    public static void main(String[] args) throws IOException {
        Parse p = new Parse();
        BufferedReader buffer = new BufferedReader(
                new InputStreamReader(System.in));
        String temp = buffer.readLine();
        InToPost itp = new InToPost(temp);
       // itp.doTrans();
        String str = itp.doTrans();
        System.out.println(str);
//            for(int x=0; x <words.length;x++){
//                str2 = str2 + words[x];
//            }
//            System.out.println(str2);
        // Stack sk = new Stack();

//        Parse parse = new Parse();
//        parse.insert(3);
//        parse.insert(6);
//        
//        parse.lookup(6);
////        System.out.println();





    }
}
